package servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import DAO.ScoreDao;
import DAO.StudentDao;
import DTO.Score;
import DTO.Student;

public class zenjiafenshuServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		//1
		String sid=req.getParameter("sid")	;
		String cid=req.getParameter("cid")	;
		String cscore=req.getParameter("cscore")	;	
			//2
		Score s=new Score();
		s.setsId(sid);
		s.setcId(cid);
		s.setcScore(cscore);
			ScoreDao sd=new ScoreDao();
			int flag=sd.insertInformationToScore(s);
			if(flag==1)
			resp.sendRedirect(req.getContextPath()+"/admin.html");
			else
				resp.sendRedirect(req.getContextPath()+"/admin/zengjiafenshu.html");
			//3
		}

	}
